function ccrTargetCount(yards)
	local vMobCount 

	if yards == nil then yards = 12 end;
	if vLastTargetCountScan == nil
	or (GetTime()-vLastTargetCountScan) > 0.10
	then
		vMobCount = 0
		for i = 0, # tblTGetNearbyEnemies do
			local tblObj = tblTGetNearbyEnemies[i]
			if tblObj ~= nil
			and tblObj:Exists()
			and (tblObj:GetType() == 3 or tblObj:GetType() == 4)
			and Target and Target:Exists() and not Target:IsDead()
			and tblObj:GetDistance(Target) <= yards + tblObj:GetCombatReach()
			and tblObj:GetCreatureInfo() ~= "Critter"
			and tblObj:GetCreatureInfo() ~= "Critter nil"
			and tblObj:GetCreatureInfo() ~= "Wild Pet"
			and tblObj:GetCreatureInfo() ~= "Totem"
			and tblObj:GetName() ~= "Dreadspinner Egg"
			and tblObj:GetName() ~= "Creeper Egg"
			and tblObj:GetName() ~= "Manifestation"
			and tblObj:GetName() ~= "Kor'kron Cannon"
			and tblObj:GetAura("Detonation Sequence") ~= "Detonation Sequence"
			and not tblObj:IsDead()
			and Player:CanAttack(tblObj)
			then
				vMobCount = vMobCount + 1
			end
		end
		if vMobCount == nil then vMobCount = 0 end;
		-- Custom
		if ccrTargetName() == "Training Bag"
		or ccrTargetName() == "Training Dummy"
		or ccrTargetName() == "Raider's Training Dummy"
		or ccrTargetName() == "Headless Horseman"
		or ccrTargetName() == "Head of the Horseman"
		then
			vMobCount = 1
		end;
		vLastTargetCountScan = GetTime()
		vLastTargetCount = vMobCount
	else
		if vLastTargetCount ~= nil then return vLastTargetCount end;
	end

	if vMobCount ~= nil then return vMobCount end;
end

function ccrPlayerCount(yards)
	local vMobCount

	if yards == nil then yards = 12 end;
	if vLastPlayerCountScan == nil
	or (GetTime()-vLastPlayerCountScan) > 0.10
	then
		vMobCount = 0
		for i = 0, # tblPGetNearbyEnemies do
			local tblObj = tblPGetNearbyEnemies[i]
			if tblObj ~= nil
			and tblObj:Exists()
			and (tblObj:GetType() == 3 or tblObj:GetType() == 4)
			and tblObj:GetDistance(Player) <= yards + tblObj:GetCombatReach()
			and tblObj:GetCreatureInfo() ~= "Critter"
			and tblObj:GetCreatureInfo() ~= "Critter nil"
			and tblObj:GetCreatureInfo() ~= "Wild Pet"
			and tblObj:GetCreatureInfo() ~= "Totem"
			and tblObj:GetName() ~= "Dreadspinner Egg"
			and tblObj:GetName() ~= "Creeper Egg"
			and tblObj:GetName() ~= "Manifestation"
			and tblObj:GetName() ~= "Kor'kron Cannon"
			and tblObj:GetAura("Detonation Sequence") ~= "Detonation Sequence"
			and not tblObj:IsDead()
			and Player:CanAttack(tblObj)
			then
				vMobCount = vMobCount + 1
			end
		end
		if vMobCount == nil then vMobCount = 0 end;
		-- Custom
		if ccrTargetName() == "Training Bag"
		or ccrTargetName() == "Training Dummy"
		or ccrTargetName() == "Raider's Training Dummy"
		or ccrTargetName() == "Headless Horseman"
		or ccrTargetName() == "Head of the Horseman"
		then
			vMobCount = 1
		end;
		vLastPlayerCountScan = GetTime()
		vLastPlayerCount = vMobCount
	else
		if vLastPlayerCount ~= nil then return vLastPlayerCount end;
	end

	if vMobCount ~= nil then return vMobCount end;
end

function ccR_HostilesNearPlayer(yards)
	if yards == nil then yards = 8 end
	local x
	local vHostileNearPlayerCount = 0
	tblPGetMeleeEnemies = {}
	if # tblPGetNearbyEnemies > 0 then
		for x = 1, # tblPGetNearbyEnemies do
			local obj = tblPGetNearbyEnemies[x]
			if obj
			and obj:Exists()
			and not obj:IsDead()
			and obj:GetDistance(Player) <= yards
			then
				vHostileNearPlayerCount = vHostileNearPlayerCount + 1
			end
		end
	end
	return vHostileNearPlayerCount
end